﻿/// <reference path="_namespace.js" />
/// <reference path="../BaseObject.js" />
/// <reference path="CullModes.js" />
/// <reference path="FillModes.js" />
/// <reference path="ShadeModes.js" />
/// <reference path="FrustumCullModes.js" />

/*****************************************************************************
Ajax library class definition. Kevin Robinson 2008.
Class: ajax.drawing.RenderStateManager
/*****************************************************************************/

ajax.lang.addNamespace("ajax.drawing");
$imports("ajax.drawing.CullModes");
$imports("ajax.drawing.FillModes");
$imports("ajax.drawing.ShadeModes");
$imports("ajax.drawing.FrustumCullModes");

/*****************************************************************************/
ajax.drawing.RenderStateManager = function()
{///<field name="objectFrustumCullMode" type="ajax.drawing.FrustumCullModes">Gets or sets the cull mode of objects to the GraphicsDevice BoundingFrustum. Default is XYZ.</field>
 ///<field name="faceFrustumCullMode" type="ajax.drawing.FrustumCullModes">Gets or sets the cull mode of faces to the Bounding Frustum. Default is ZOnly.</field> 
 ///<field name="nearZPolyClipEnabled" type="boolean">Gets or sets the Enabling of clipping of polygons as they pass the minDepth boundary of your viewpport. Default true.</field>
 ///<field name="cullMode" type="ajax.drawing.CullModes">Gets or sets the culling mode used when rendering geometry. Default is AntiClockwise.</field>
 ///<field name="fillMode" type="ajax.drawing.FillModes">Gets or sets the fill mode used when rendering geometry. Default is Wireframe.</field>
 ///<field name="shadeMode" type="ajax.drawing.ShadeModes">Gets or sets the shade mode used when rendering geometry. Default is Flat.</field> 

    ajax.drawing.RenderStateManager.superConstructor.call(this);
    this.initialize();
}
ajax.lang.extend("ajax.drawing.RenderStateManager", "ajax.BaseObject");
/*****************************************************************************/

/*
    public boolean Lighting                             = false;
    public boolean ZBufferEnabled                       = false;
    public int ObjectFrustumCullMode                    = FrustumCullingMode.XYZ;
    public int FaceFrustumCullMode                      = FrustumCullingMode.XYZ;
    public boolean NearZPolyClipEnabled                 = true;
    public int CullMode                                 = CullingMode.AntiClockwise;
    public int FillMode                                 = FillingMode.Solid;
    public int ShadeMode                                = ShadingMode.Flat;
*/

ajax.drawing.RenderStateManager.prototype.lighting              = false;
ajax.drawing.RenderStateManager.prototype.zBufferEnabled        = false;
ajax.drawing.RenderStateManager.prototype.objectFrustumCullMode = ajax.drawing.FrustumCullModes.XYZ;
ajax.drawing.RenderStateManager.prototype.faceFrustumCullMode   = ajax.drawing.FrustumCullModes.ZOnly;
ajax.drawing.RenderStateManager.prototype.nearZPolyClipEnabled  = true;

ajax.drawing.RenderStateManager.prototype.cullMode              = ajax.drawing.CullModes.AntiClockwise;
ajax.drawing.RenderStateManager.prototype.fillMode              = ajax.drawing.FillModes.Wireframe;
ajax.drawing.RenderStateManager.prototype.shadeMode             = ajax.drawing.ShadeModes.Flat;

ajax.drawing.RenderStateManager.prototype.renderingEnabled      = true;

/*****************************************************************************/
ajax.drawing.RenderStateManager.prototype.initialize            = function()
{    
}
/*****************************************************************************/
ajax.drawing.RenderStateManager.cast = function(obj)
{///<returns type="ajax.drawing.RenderStateManager"/>
    return obj;
}
